package com.myrpc.test.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class ReflectClassTs {
	public static void main(String[] args) throws Exception  {
		Class<MyUser> myuser = (Class<MyUser>) Class.forName("com.myrpc.test.reflect.MyUser");
		Class<?>[] classes = myuser.getClasses();
		System.out.println(classes);
		Method[] methods = myuser.getMethods();
		System.out.println(methods);
		String name = myuser.getName();
		Field[] fields = myuser.getFields();
		
		//invoke
		Method method = myuser.getMethod("dowork", String.class);
		method.invoke(myuser.newInstance(),"hello");
	}

}
